/**
 * Created by An on 2016/4/8.
 */

$(function () {
    $(".search").click(function () {
        var v = $(".edt .w").val();
        $(".edt .w").value = "";


    });


    $.get("http://fanyi.youdao.com/openapi.do?keyfrom=cikean&key=1360423827&type=data&doctype=json&version=1.1&q=good"
        //+ $(this).serialize(),
        , function (data) {
            console.log("info:" + data + status);

        });


    $("form").submit(function () {
        console.log("---------------------")
        //$.get("http://www.baidu.com",function(data){
        //    console.log(data)
        //});

        //alert($(this).serialize());
        $.get("http://fanyi.youdao.com/openapi.do?keyfrom=cikean&key=1360423827&type=data&doctype=json&version=1.1&q=good"
            //+ $(this).serialize(),
            , function (data) {
                console.log("info:" + data + status);

            });


    });


    var widths = $(".top_title li:nth-child(6)").outerWidth();
    var lefts = $(".top_title li:nth-child(6)").position().left;
    $(".divLine").css({width: widths, left: lefts});

    $(".top_title li a").hover(function () {

        var widths = $(this).outerWidth();
        var lefts = $(this).position().left;
        $(".divLine").css({width: widths, left: lefts});

    }, function () {
    });

    function sendInfo(urls) {
        $.ajax(urls, {

            success: function (data) {
                console.log("success:" + arguments);
            },

            error: function (jqXHR, textStatus, err) {

                // jqXHR: jQuery增强的xhr
                // textStatus: 请求完成状态
                // err: 底层通过throw抛出的异常对象，类型与值与错误类型有关
                console.log("error:" + arguments);
            },

            complete: function (jqXHR, textStatus) {
                // jqXHR: jQuery增强的xhr
                // textStatus: 请求完成状态 success | error
                console.log('statusCode: %d, statusText: %s', jqXHR.status, jqXHR.statusText);
                console.log('textStatus: %s', textStatus);
            },

            statusCode: {
                '403': function (jqXHR, textStatus, err) {
                    console.log(arguments);
                    console.log('status code 403');
                },
                '400': function () {
                    console.log('status code 400');
                },

                '0': function () {
                    console.log('status code 0');
                }
            }
        });
    }


});
